<noscript>
Ihr Browser unterstützt JavaScript nicht, oder es ist ausgeschaltet!
</noscript>

<script type="text/javascript" defer="defer">
//Function to Calculate the endprice of a product with jQuery
function Berechnen(prodPrice)
{
	//Set baseprice
	var endPrice = parseFloat(prodPrice);
	 
	//add all optionprices to baseprice
	$('* :selected').each(function(i, selected)
	{
		//parse optionprices if needed
		var OptSet = $(selected).val();
		var Opt = OptSet.split(" (");
		endPrice += parseFloat(Opt[0]);
	});

	//Check if all options are selected --> otherwise there is no "Add to Cart" button
	if ( !isNaN(endPrice) )
	{
		$(".product-price").html("$" +endPrice);
	}
	else
	{
		$(".product-price").html("Bitte alle Option(en) wählen");
	}
}
</script>

<?php

	$product = $_REQUEST["product"];
    $connection->getProductDetails($product);
    
?>